//
//  RankHeadView.m
//  XingRun
//
//  Created by 赵颜彬 on 17/1/11.
//  Copyright © 2017年 赵颜彬. All rights reserved.
//

#import "RankHeadView.h"

@implementation RankHeadView

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        /**< SegentedControl 分段控制器*/
        UISegmentedControl *seg = [[UISegmentedControl alloc] initWithItems:@[@"1h",@"2h",@"3h",@">3h"]];
        //设置frame
        seg.frame = CGRectMake(30, 20, 300, 40);
        //添加父视图
        [self addSubview:seg];
        //背景颜色
        seg.backgroundColor = [UIColor whiteColor];
        seg.tintColor = [UIColor blackColor];
        //分段索引
        seg.selectedSegmentIndex = 0;

        //添加点击事件
        //valueChange 值变化时 触发方法
        [seg addTarget:self action:@selector(segAction:) forControlEvents:UIControlEventValueChanged];

    }
    return self;
}

-(void)segAction:(UISegmentedControl *)seg{
    
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
